package com.haste.controller;

import com.haste.service.PaymentService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @ClassName:PaymentController
 * @Description:
 * @Author:Haste
 * @Date:2021/2/8 9:29
 */
@RestController
public class PaymentController {
    @Resource
    private PaymentService paymentService;

    @GetMapping("/hystrix/payment/info/{id}")
    public String paymentInfo(@PathVariable("id") Integer id){
        return paymentService.paymentInfo(id);
    }

    @GetMapping("/hystrix/payment/timeout/{id}")
    public String paymentInfoTimeout(@PathVariable("id") Integer id){
        return paymentService.paymentInfoTimeout(id);
    }

    @GetMapping("/hystrix/payment/breaker/{id}")
    public String paymentBreaker(@PathVariable("id") Integer id){
        return paymentService.paymentBreaker(id);
    }
}
